<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>构造函数</title>



    <script>
        //对象构造函数
        function Student(name, age) {
            this.name = name;
            this.age = age;

        }

        var s1 = new Student('小猫', 24);
        var s2 = new Student('小艾', 24);


        console.log(s1.name);
        console.log(s2.name);
    </script>



</head>

<body>

</body>

</html>